package com.wc.AlgoOJ_homework.AlgoOJ_HomeWork1.R_纸张尺寸;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/20 15:40
 * @description http://43.138.190.70:8888/p/517
 */
public class Main {
    public static void main(String[] args) {
        int[][] ans = new int[10][2];
        int h = 1189;
        int w = 841;
        ans[0][0] = h;
        ans[0][1] = w;
        for (int i = 1; i < 10; i++) {
            h /= 2;
            if (h < w) {
                int tmp = h;
                h = w;
                w = tmp;
            }
            ans[i][0] = h;
            ans[i][1] = w;
        }
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int idx = s.charAt(1) - '0';
        System.out.println(ans[idx][0]);
        System.out.println(ans[idx][1]);
    }
}

